package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonGetter;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author CDHong
 * @since 2024-10-17 08:59
 */
@Data
public class Emp implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("empno")
    private Integer empno;

    private String ename;

    private String job;

    private Integer mgr;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime hiredate;

    private Double sal;

    private Double comm;

    private Integer deptno;

    @JsonGetter
    public Double getComm() {
        if(comm==null){
            return 0.0;
        }
        return comm;
    }
}
